package com.techstar.ats;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;
import com.techstar.ats.service.LiveService;
import com.techstar.ats.utils.SharedUtils;

@Configuration
@EnableConfigurationProperties({AtsProperties.class, FtpProperties.class})
public class NettyConfiguration implements DisposableBean {

	@Bean
	public LiveService liveService(JdbcTemplate jdbcTemplate) {
		return new LiveService(jdbcTemplate);
	}

	@Override
	public void destroy() {
		SharedUtils.releaseSharedResources();
	}
}
